package com.luyuan.gallery.service.impl;

import java.util.List;
import com.luyuan.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.luyuan.gallery.mapper.ExhiGalleryMapper;
import com.luyuan.gallery.domain.ExhiGallery;
import com.luyuan.gallery.service.IExhiGalleryService;
import com.luyuan.gallery.vo.ExhiGalleryVO;

/**
 * 展厅Service业务层处理
 * 
 * @author luyuan
 * @date 2025-11-13
 */
@Service
public class ExhiGalleryServiceImpl implements IExhiGalleryService {
    @Autowired
    private ExhiGalleryMapper exhiGalleryMapper;

    /**
     * 查询展厅
     * 
     * @param galleryId 展厅主键
     * @return 展厅
     */
    @Override
    public ExhiGalleryVO selectExhiGalleryByGalleryId(Long galleryId) {
        return exhiGalleryMapper.selectExhiGalleryByGalleryId(galleryId);
    }

    /**
     * 查询展厅列表
     * 
     * @param exhiGallery 展厅
     * @return 展厅
     */
    @Override
    public List<ExhiGalleryVO> selectExhiGalleryList(ExhiGallery exhiGallery) {
        return exhiGalleryMapper.selectExhiGalleryList(exhiGallery);
    }

    /**
     * 新增展厅
     * 
     * @param exhiGallery 展厅
     * @return 结果
     */
    @Override
    public int insertExhiGallery(ExhiGallery exhiGallery) {
        exhiGallery.setCreateTime(DateUtils.getNowDate());
        return exhiGalleryMapper.insertExhiGallery(exhiGallery);
    }

    /**
     * 修改展厅
     * 
     * @param exhiGallery 展厅
     * @return 结果
     */
    @Override
    public int updateExhiGallery(ExhiGallery exhiGallery) {
        exhiGallery.setUpdateTime(DateUtils.getNowDate());
        return exhiGalleryMapper.updateExhiGallery(exhiGallery);
    }

    /**
     * 批量删除展厅
     * 
     * @param galleryIds 需要删除的展厅主键
     * @return 结果
     */
    @Override
    public int deleteExhiGalleryByGalleryIds(Long[] galleryIds) {
        return exhiGalleryMapper.deleteExhiGalleryByGalleryIds(galleryIds);
    }

    /**
     * 删除展厅信息
     * 
     * @param galleryId 展厅主键
     * @return 结果
     */
    @Override
    public int deleteExhiGalleryByGalleryId(Long galleryId) {
        return exhiGalleryMapper.deleteExhiGalleryByGalleryId(galleryId);
    }
}
